package cn.lx.expansion.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author lixin
 * @Classname GamePlayTH
 * @Description TODO
 * @Date 2019/10/5 下午3:37
 */
public class GamePlayTH implements InvocationHandler {

    // 被代理者
    Class cls = null;
    // 被代理的实例
    Object obj = null;

    // 我要代理谁
    public GamePlayTH(Object _obj) {
        this.obj = _obj;
    }


    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object result = method.invoke(this.obj, args);
        if(method.getName().equalsIgnoreCase("login")){
            System.out.println("代理使用");

        }
        return result;
    }
}
